home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
UUPC11QS.ARJ
/
MKMBOX.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-11-21
|
3KB
|
66 lines
/*--------------------------------------------------------------------*/
/* m k m b o x . h */
/* */
/* Host Support routines for UUPC/extended */
/* */
/* Changes Copyright 1990, 1991 (c) Andrew H. Derbyshire */
/* */
/* History: */
/* 21Nov1991 Break out of hlib.c ahd */
/*--------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/*--------------------------------------------------------------------*/
/* UUPC/extended include files */
/*--------------------------------------------------------------------*/
#include "lib.h"
#include "hlib.h"
/*--------------------------------------------------------------------*/
/* Global variables */
/*--------------------------------------------------------------------*/
currentfile();
/*--------------------------------------------------------------------*/
/* m k m a i l b o x */
/* */
/* Build a mailbox name */
/*--------------------------------------------------------------------*/
char *mkmailbox(char *buf, const char *userid)
{
boolean append = ( E_mailext != NULL );
if (buf == NULL) /* Do we need to allocate buffer? */
{
buf = malloc( FILENAME_MAX );
checkref(buf);
} /* if */
if (bflag[F_DIRECT])
{
sprintf(buf,"%s%c%s%c%s", maildir, SEPCHAR,
userid, SEPCHAR,"newmail");
} /* if (bflag[F_DIRECT]) */
else {
mkfilename(buf, maildir, userid);
append &= (strchr(userid, '.') == NULL );
} /* else */
/*--------------------------------------------------------------------*/
/* If we need a mailbox extension, add one */
/*--------------------------------------------------------------------*/
if ( append )
strcat( strcat(buf,".") , E_mailext );
return buf;
} /* mkmailbox */